.class public Lcom/estrongs/android/util/q0;
.super Ljava/lang/Object;
.source "VisitHistory.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/android/util/q0$a;
    }
.end annotation


# static fields
.field private static c:Ljava/lang/String;

.field private static d:Lcom/estrongs/android/util/q0;

.field private static e:I

.field private static final f:Ljava/util/LinkedList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/LinkedList<",
            "Lcom/estrongs/android/util/q0$a;",
            ">;"
        }
    .end annotation
.end field

.field private static g:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap<",
            "Ljava/lang/String;",
            "Landroid/graphics/Bitmap;",
            ">;"
        }
    .end annotation
.end field

.field private static final h:Lcom/estrongs/android/util/q0;


# instance fields
.field private a:Landroid/database/sqlite/SQLiteDatabase;

.field private b:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 1
    new-instance v0, Ljava/util/LinkedList;

    invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V

    sput-object v0, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    .line 2
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    .line 3
    new-instance v0, Lcom/estrongs/android/util/q0;

    invoke-direct {v0}, Lcom/estrongs/android/util/q0;-><init>()V

    sput-object v0, Lcom/estrongs/android/util/q0;->h:Lcom/estrongs/android/util/q0;

    return-void
.end method

.method private constructor <init>()V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    const/4 v0, 0x0

    .line 3
    iput-boolean v0, p0, Lcom/estrongs/android/util/q0;->b:Z

    return-void
.end method

.method private constructor <init>(Landroid/database/sqlite/SQLiteDatabase;)V
    .locals 1
    .param p1    # Landroid/database/sqlite/SQLiteDatabase;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    .line 4
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 5
    iput-object v0, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    const/4 v0, 0x0

    .line 6
    iput-boolean v0, p0, Lcom/estrongs/android/util/q0;->b:Z

    .line 7
    iput-object p1, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    return-void
.end method

.method private static a(Ljava/lang/String;)Ljava/lang/String;
    .locals 2

    if-nez p0, :cond_0

    const-string p0, "\"\""

    return-object p0

    .line 13
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "\""

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method private static a(Landroid/database/sqlite/SQLiteDatabase;)V
    .locals 1
    .param p0    # Landroid/database/sqlite/SQLiteDatabase;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    :try_start_0
    const-string v0, "CREATE TABLE IF NOT EXISTS visit_history (id INTEGER PRIMARY KEY,isdir INTEGER,title TEXT,path TEXT UNIQUE)"

    .line 1
    invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    const-string v0, "CREATE TABLE IF NOT EXISTS cachedb_version (dbver INTEGER UNIQUE)"

    .line 2
    invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    const-string v0, "CREATE TABLE IF NOT EXISTS web_icon (domain TEXT UNIQUE, icon BLOB)"

    .line 3
    invoke-virtual {p0, v0}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 4
    invoke-static {p0}, Lcom/estrongs/android/util/q0;->c(Landroid/database/sqlite/SQLiteDatabase;)I

    move-result v0

    .line 5
    invoke-static {p0, v0}, Lcom/estrongs/android/util/q0;->a(Landroid/database/sqlite/SQLiteDatabase;I)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception p0

    .line 6
    invoke-virtual {p0}, Ljava/lang/Exception;->printStackTrace()V

    :goto_0
    return-void
.end method

.method private static a(Landroid/database/sqlite/SQLiteDatabase;I)V
    .locals 2
    .param p0    # Landroid/database/sqlite/SQLiteDatabase;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    const/4 v0, 0x4

    if-ne p1, v0, :cond_0

    return-void

    :cond_0
    const/4 v1, 0x2

    if-ge p1, v1, :cond_1

    :try_start_0
    const-string v1, "ALTER TABLE visit_history ADD isdir INTEGER"

    .line 7
    invoke-virtual {p0, v1}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v1

    .line 8
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    :cond_1
    :goto_0
    const/4 v1, 0x3

    if-ge p1, v1, :cond_2

    .line 9
    invoke-static {p0}, Lcom/estrongs/android/util/q0;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    :cond_2
    if-ge p1, v0, :cond_3

    :try_start_1
    const-string p1, "ALTER TABLE visit_history ADD title TEXT"

    .line 10
    invoke-virtual {p0, p1}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_1

    :catch_1
    move-exception p1

    .line 11
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    :cond_3
    :goto_1
    const-string p1, "UPDATE cachedb_version SET dbver=4"

    .line 12
    invoke-virtual {p0, p1}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    return-void
.end method

.method private a(Ljava/util/LinkedList;Lcom/estrongs/android/util/q0$a;Z)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/LinkedList<",
            "Lcom/estrongs/android/util/q0$a;",
            ">;",
            "Lcom/estrongs/android/util/q0$a;",
            "Z)V"
        }
    .end annotation

    if-nez p1, :cond_0

    return-void

    :cond_0
    if-eqz p3, :cond_1

    .line 73
    invoke-virtual {p1, p2}, Ljava/util/LinkedList;->addFirst(Ljava/lang/Object;)V

    goto :goto_0

    .line 74
    :cond_1
    invoke-virtual {p1, p2}, Ljava/util/LinkedList;->addLast(Ljava/lang/Object;)V

    :goto_0
    return-void
.end method

.method private static b(Landroid/database/sqlite/SQLiteDatabase;)V
    .locals 12
    .param p0    # Landroid/database/sqlite/SQLiteDatabase;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    const-string v0, "id"

    const/4 v1, 0x0

    :try_start_0
    const-string v3, "visit_history"

    const/4 v2, 0x2

    new-array v4, v2, [Ljava/lang/String;

    const/4 v10, 0x0

    aput-object v0, v4, v10

    const-string v2, "path"

    const/4 v11, 0x1

    aput-object v2, v4, v11

    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    move-object v2, p0

    .line 2
    invoke-virtual/range {v2 .. v9}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    if-eqz v1, :cond_4

    .line 3
    invoke-interface {v1}, Landroid/database/Cursor;->getCount()I

    move-result v2

    if-nez v2, :cond_0

    goto :goto_1

    .line 4
    :cond_0
    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    :goto_0
    if-eqz v2, :cond_2

    .line 5
    invoke-interface {v1, v11}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    .line 6
    invoke-static {v2}, Lcom/estrongs/android/util/h0;->i(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 7
    invoke-virtual {v3, v2}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 8
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "UPDATE visit_history  SET path="

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-static {v3}, Lcom/estrongs/android/util/q0;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, " WHERE "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, "="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, ""

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-interface {v1, v10}, Landroid/database/Cursor;->getInt(I)I

    move-result v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/estrongs/android/util/q0;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 9
    invoke-virtual {p0, v2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 10
    :cond_1
    invoke-interface {v1}, Landroid/database/Cursor;->moveToNext()Z

    move-result v2
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :cond_2
    if-eqz v1, :cond_3

    .line 11
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    :cond_3
    return-void

    :cond_4
    :goto_1
    if-eqz v1, :cond_5

    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    :cond_5
    return-void

    :catchall_0
    move-exception p0

    goto :goto_2

    :catch_0
    move-exception p0

    .line 12
    :try_start_1
    invoke-virtual {p0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    if-eqz v1, :cond_6

    .line 13
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    :cond_6
    return-void

    :goto_2
    if-eqz v1, :cond_7

    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    .line 14
    :cond_7
    goto :goto_4

    :goto_3
    throw p0

    :goto_4
    goto :goto_3
.end method

.method public static b(Ljava/lang/String;)V
    .locals 1

    .line 1
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string p0, "/"

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    sput-object p0, Lcom/estrongs/android/util/q0;->c:Ljava/lang/String;

    return-void
.end method

.method private static c(Landroid/database/sqlite/SQLiteDatabase;)I
    .locals 10
    .param p0    # Landroid/database/sqlite/SQLiteDatabase;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    const/4 v0, 0x0

    const/4 v1, 0x0

    :try_start_0
    const-string v3, "cachedb_version"

    const/4 v2, 0x1

    new-array v4, v2, [Ljava/lang/String;

    const-string v2, "dbver"

    aput-object v2, v4, v0

    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    move-object v2, p0

    .line 1
    invoke-virtual/range {v2 .. v9}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    if-eqz v1, :cond_2

    .line 2
    invoke-interface {v1}, Landroid/database/Cursor;->getCount()I

    move-result v2

    if-nez v2, :cond_0

    goto :goto_0

    .line 3
    :cond_0
    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    .line 4
    invoke-interface {v1, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result p0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v1, :cond_1

    .line 5
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    :cond_1
    return p0

    :cond_2
    :goto_0
    :try_start_1
    const-string v2, "INSERT INTO cachedb_version (dbver) values(4)"

    .line 6
    invoke-virtual {p0, v2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    const/4 p0, 0x4

    if-eqz v1, :cond_3

    .line 7
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    :cond_3
    return p0

    :catchall_0
    move-exception p0

    goto :goto_1

    :catch_0
    move-exception p0

    .line 8
    :try_start_2
    invoke-virtual {p0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    if-eqz v1, :cond_4

    .line 9
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    :cond_4
    return v0

    :goto_1
    if-eqz v1, :cond_5

    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    .line 10
    :cond_5
    throw p0
.end method

.method public static declared-synchronized i()Lcom/estrongs/android/util/q0;
    .locals 3
    .annotation build Landroidx/annotation/NonNull;
    .end annotation

    const-class v0, Lcom/estrongs/android/util/q0;

    monitor-enter v0

    .line 1
    :try_start_0
    sget-object v1, Lcom/estrongs/android/util/q0;->d:Lcom/estrongs/android/util/q0;

    if-nez v1, :cond_3

    .line 2
    sget-object v1, Lcom/estrongs/android/util/q0;->c:Ljava/lang/String;

    if-eqz v1, :cond_2

    sget-boolean v1, Lcom/estrongs/android/pop/j;->l0:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v1, :cond_0

    goto :goto_0

    .line 3
    :cond_0
    :try_start_1
    new-instance v1, Ljava/io/File;

    sget-object v2, Lcom/estrongs/android/util/q0;->c:Ljava/lang/String;

    invoke-direct {v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Ljava/io/File;->mkdirs()Z

    .line 4
    invoke-static {}, Lcom/estrongs/android/util/q0;->j()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    if-eqz v1, :cond_1

    .line 5
    new-instance v2, Lcom/estrongs/android/util/q0;

    invoke-direct {v2, v1}, Lcom/estrongs/android/util/q0;-><init>(Landroid/database/sqlite/SQLiteDatabase;)V

    .line 6
    sput-object v2, Lcom/estrongs/android/util/q0;->d:Lcom/estrongs/android/util/q0;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 7
    monitor-exit v0

    return-object v2

    .line 8
    :cond_1
    :try_start_2
    sget-object v1, Lcom/estrongs/android/util/q0;->h:Lcom/estrongs/android/util/q0;
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    monitor-exit v0

    return-object v1

    .line 9
    :catch_0
    :try_start_3
    sget-object v1, Lcom/estrongs/android/util/q0;->h:Lcom/estrongs/android/util/q0;
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    monitor-exit v0

    return-object v1

    .line 10
    :cond_2
    :goto_0
    :try_start_4
    sget-object v1, Lcom/estrongs/android/util/q0;->h:Lcom/estrongs/android/util/q0;
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    monitor-exit v0

    return-object v1

    .line 11
    :cond_3
    :try_start_5
    sget-object v1, Lcom/estrongs/android/util/q0;->d:Lcom/estrongs/android/util/q0;
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    monitor-exit v0

    return-object v1

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method

.method private static j()Landroid/database/sqlite/SQLiteDatabase;
    .locals 3
    .annotation build Landroidx/annotation/Nullable;
    .end annotation

    .line 1
    new-instance v0, Ljava/io/File;

    sget-object v1, Lcom/estrongs/android/util/q0;->c:Ljava/lang/String;

    const-string v2, "visit_history"

    invoke-direct {v0, v1, v2}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v1, 0x0

    .line 2
    :try_start_0
    invoke-static {v0, v1}, Landroid/database/sqlite/SQLiteDatabase;->openOrCreateDatabase(Ljava/io/File;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2

    if-nez v2, :cond_0

    .line 3
    invoke-virtual {v0}, Ljava/io/File;->delete()Z

    .line 4
    invoke-static {v0, v1}, Landroid/database/sqlite/SQLiteDatabase;->openOrCreateDatabase(Ljava/io/File;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2

    if-nez v2, :cond_0

    return-object v1

    .line 5
    :cond_0
    invoke-static {v2}, Lcom/estrongs/android/util/q0;->a(Landroid/database/sqlite/SQLiteDatabase;)V
    :try_end_0
    .catch Landroid/database/sqlite/SQLiteDiskIOException; {:try_start_0 .. :try_end_0} :catch_0

    return-object v2

    :catch_0
    move-exception v2

    .line 6
    invoke-virtual {v0}, Ljava/io/File;->delete()Z

    .line 7
    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDiskIOException;->printStackTrace()V

    return-object v1
.end method

.method private k()V
    .locals 11

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_b

    sget v1, Lcom/estrongs/android/util/q0;->e:I

    if-nez v1, :cond_0

    goto/16 :goto_6

    :cond_0
    const/4 v8, 0x0

    :try_start_0
    const-string v1, "web_icon"

    const/4 v2, 0x2

    new-array v2, v2, [Ljava/lang/String;

    const-string v3, "domain"

    const/4 v9, 0x0

    aput-object v3, v2, v9

    const-string v3, "icon"

    const/4 v10, 0x1

    aput-object v3, v2, v10

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    .line 2
    invoke-virtual/range {v0 .. v7}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    if-eqz v0, :cond_7

    .line 3
    :try_start_1
    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v1

    if-nez v1, :cond_1

    goto :goto_3

    .line 4
    :cond_1
    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v1

    const/16 v2, 0x14

    if-le v1, v2, :cond_2

    sub-int/2addr v1, v2

    .line 5
    invoke-interface {v0, v1}, Landroid/database/Cursor;->moveToPosition(I)Z

    move-result v1

    goto :goto_0

    .line 6
    :cond_2
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1

    .line 7
    :goto_0
    sget-object v2, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    invoke-virtual {v2}, Ljava/util/HashMap;->clear()V

    :goto_1
    if-eqz v1, :cond_5

    .line 8
    invoke-interface {v0, v10}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v1

    if-eqz v1, :cond_3

    .line 9
    array-length v2, v1

    invoke-static {v1, v9, v2}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v1

    goto :goto_2

    :cond_3
    move-object v1, v8

    :goto_2
    if-eqz v1, :cond_4

    .line 10
    sget-object v2, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    invoke-interface {v0, v9}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 11
    :cond_4
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    move-result v1
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_1

    :cond_5
    if-eqz v0, :cond_6

    .line 12
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    :cond_6
    return-void

    :catchall_0
    move-exception v1

    move-object v8, v0

    goto :goto_5

    :catch_0
    move-exception v1

    move-object v8, v0

    goto :goto_4

    :cond_7
    :goto_3
    if-eqz v0, :cond_8

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    :cond_8
    return-void

    :catchall_1
    move-exception v1

    goto :goto_5

    :catch_1
    move-exception v1

    .line 13
    :goto_4
    :try_start_2
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    if-eqz v8, :cond_9

    .line 14
    invoke-interface {v8}, Landroid/database/Cursor;->close()V

    :cond_9
    return-void

    :goto_5
    if-eqz v8, :cond_a

    invoke-interface {v8}, Landroid/database/Cursor;->close()V

    .line 15
    :cond_a
    throw v1

    :cond_b
    :goto_6
    return-void
.end method


# virtual methods
.method public a(Ljava/lang/String;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 7

    const/4 v0, 0x0

    if-nez p1, :cond_0

    return-object v0

    .line 54
    :cond_0
    :try_start_0
    sget-object v1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    monitor-enter v1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 55
    :try_start_1
    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object p1

    .line 56
    invoke-virtual {p1}, Landroid/net/Uri;->getHost()Ljava/lang/String;

    move-result-object p1

    if-nez p1, :cond_1

    .line 57
    monitor-exit v1

    return-object v0

    :cond_1
    if-eqz p2, :cond_6

    .line 58
    sget-object v2, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    invoke-virtual {v2, p1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_6

    const/4 v2, 0x0

    .line 59
    sget-object v3, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    invoke-virtual {v3}, Ljava/util/HashMap;->size()I

    move-result v3

    const/16 v4, 0x14

    if-le v3, v4, :cond_2

    .line 60
    sget-object v2, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    invoke-virtual {v2}, Ljava/util/HashMap;->clear()V

    const/4 v2, 0x1

    .line 61
    :cond_2
    sget-object v3, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {v3}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :cond_3
    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_5

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/estrongs/android/util/q0$a;

    .line 62
    iget-object v5, v4, Lcom/estrongs/android/util/q0$a;->b:Ljava/lang/String;

    if-eqz v5, :cond_4

    iget-object v5, v4, Lcom/estrongs/android/util/q0$a;->b:Ljava/lang/String;

    invoke-virtual {v5, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_4

    .line 63
    iput-object p2, v4, Lcom/estrongs/android/util/q0$a;->e:Landroid/graphics/Bitmap;

    :cond_4
    if-eqz v2, :cond_3

    .line 64
    iget-object v5, v4, Lcom/estrongs/android/util/q0$a;->b:Ljava/lang/String;

    if-eqz v5, :cond_3

    iget-object v5, v4, Lcom/estrongs/android/util/q0$a;->e:Landroid/graphics/Bitmap;

    if-eqz v5, :cond_3

    .line 65
    sget-object v5, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    iget-object v6, v4, Lcom/estrongs/android/util/q0$a;->b:Ljava/lang/String;

    iget-object v4, v4, Lcom/estrongs/android/util/q0$a;->e:Landroid/graphics/Bitmap;

    invoke-virtual {v5, v6, v4}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    .line 66
    :cond_5
    sget-object v2, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    invoke-virtual {v2, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 67
    monitor-exit v1

    return-object p2

    :cond_6
    if-eqz p2, :cond_7

    .line 68
    sget-object v2, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    invoke-virtual {v2, p1, p2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 69
    monitor-exit v1

    return-object p2

    .line 70
    :cond_7
    sget-object p2, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    invoke-virtual {p2, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Landroid/graphics/Bitmap;

    monitor-exit v1

    return-object p1

    :catchall_0
    move-exception p1

    .line 71
    monitor-exit v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    :try_start_2
    throw p1
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    :catch_0
    move-exception p1

    .line 72
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    return-object v0
.end method

.method public a()V
    .locals 2

    .line 75
    sget-object v0, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    monitor-enter v0

    .line 76
    :try_start_0
    sget-object v1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {v1}, Ljava/util/LinkedList;->clear()V

    .line 77
    monitor-exit v0

    return-void

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public a(I)V
    .locals 2

    .line 78
    sget v0, Lcom/estrongs/android/util/q0;->e:I

    if-ne p1, v0, :cond_0

    return-void

    .line 79
    :cond_0
    sget-object v0, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    monitor-enter v0

    .line 80
    :try_start_0
    sput p1, Lcom/estrongs/android/util/q0;->e:I

    .line 81
    :goto_0
    sget-object p1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {p1}, Ljava/util/LinkedList;->size()I

    move-result p1

    sget v1, Lcom/estrongs/android/util/q0;->e:I

    if-le p1, v1, :cond_1

    .line 82
    sget-object p1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {p1}, Ljava/util/LinkedList;->removeLast()Ljava/lang/Object;

    goto :goto_0

    .line 83
    :cond_1
    monitor-exit v0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_2

    :goto_1
    throw p1

    :goto_2
    goto :goto_1
.end method

.method public a(Ljava/lang/String;Ljava/lang/String;ILandroid/graphics/Bitmap;Z)V
    .locals 5

    if-nez p2, :cond_0

    return-void

    .line 19
    :cond_0
    invoke-static {}, Lcom/estrongs/android/pop/l;->L1()Lcom/estrongs/android/pop/l;

    move-result-object v0

    .line 20
    invoke-virtual {v0}, Lcom/estrongs/android/pop/l;->l1()Z

    move-result v0

    const/4 v1, 0x1

    if-eqz v0, :cond_1

    if-eq p3, v1, :cond_1

    return-void

    .line 21
    :cond_1
    invoke-static {p2}, Lcom/estrongs/android/util/h0;->U(Ljava/lang/String;)I

    move-result v0

    .line 22
    sget v2, Lcom/estrongs/android/util/q0;->e:I

    if-eqz v2, :cond_b

    .line 23
    invoke-static {p2}, Lcom/estrongs/android/util/h0;->k2(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_b

    invoke-static {p2}, Lcom/estrongs/android/util/h0;->V1(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2

    goto/16 :goto_1

    :cond_2
    const/4 v2, 0x3

    if-eq v0, v2, :cond_b

    const/16 v2, 0xd

    if-eq v0, v2, :cond_b

    const/16 v2, 0x11

    if-eq v0, v2, :cond_b

    const/16 v2, 0x18

    if-eq v0, v2, :cond_b

    const/16 v2, 0xc

    if-eq v0, v2, :cond_b

    const/16 v2, 0xe

    if-eq v0, v2, :cond_b

    const/16 v2, 0x10

    if-eq v0, v2, :cond_b

    .line 24
    invoke-static {p2}, Lcom/estrongs/android/util/h0;->m1(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    goto/16 :goto_1

    .line 25
    :cond_3
    :try_start_0
    invoke-static {}, Lcom/estrongs/android/pop/view/FileExplorerActivity;->a1()Lcom/estrongs/android/pop/view/FileExplorerActivity;

    move-result-object v0

    if-eqz v0, :cond_4

    .line 26
    invoke-virtual {v0}, Lcom/estrongs/android/pop/view/FileExplorerActivity;->Z()Lcom/estrongs/android/view/FileGridViewWrapper;

    move-result-object v0

    if-eqz v0, :cond_4

    .line 27
    invoke-virtual {v0}, Ljava/lang/Object;->hashCode()I

    move-result v0

    invoke-static {p2, v0}, Lcom/estrongs/android/pop/utils/n;->c(Ljava/lang/String;I)Z

    move-result v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    if-eqz v0, :cond_4

    return-void

    :catch_0
    move-exception v0

    .line 28
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 29
    :cond_4
    invoke-virtual {p0, p2, p4}, Lcom/estrongs/android/util/q0;->a(Ljava/lang/String;Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;

    move-result-object p4

    if-eqz p1, :cond_5

    .line 30
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v0

    if-nez v0, :cond_6

    .line 31
    :cond_5
    invoke-static {p2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object p1

    .line 32
    invoke-virtual {p1}, Landroid/net/Uri;->getHost()Ljava/lang/String;

    move-result-object p1

    .line 33
    :cond_6
    sget-object v0, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    monitor-enter v0

    .line 34
    :try_start_1
    sget-object v2, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {v2}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_7
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_8

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/estrongs/android/util/q0$a;

    .line 35
    iget-object v4, v3, Lcom/estrongs/android/util/q0$a;->a:Ljava/lang/String;

    if-eqz v4, :cond_7

    iget-object v4, v3, Lcom/estrongs/android/util/q0$a;->a:Ljava/lang/String;

    invoke-virtual {v4, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_7

    .line 36
    sget-object p2, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {p2, v3}, Ljava/util/LinkedList;->remove(Ljava/lang/Object;)Z

    .line 37
    iput-object p1, v3, Lcom/estrongs/android/util/q0$a;->d:Ljava/lang/String;

    .line 38
    iput p3, v3, Lcom/estrongs/android/util/q0$a;->c:I

    .line 39
    iput-object p4, v3, Lcom/estrongs/android/util/q0$a;->e:Landroid/graphics/Bitmap;

    .line 40
    sget-object p1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {p1, v3}, Ljava/util/LinkedList;->addFirst(Ljava/lang/Object;)V

    .line 41
    monitor-exit v0

    return-void

    .line 42
    :cond_8
    new-instance v2, Lcom/estrongs/android/util/q0$a;

    invoke-direct {v2}, Lcom/estrongs/android/util/q0$a;-><init>()V

    .line 43
    iput-object p1, v2, Lcom/estrongs/android/util/q0$a;->d:Ljava/lang/String;

    .line 44
    iput-object p2, v2, Lcom/estrongs/android/util/q0$a;->a:Ljava/lang/String;

    .line 45
    invoke-static {p2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object p1

    .line 46
    invoke-virtual {p1}, Landroid/net/Uri;->getHost()Ljava/lang/String;

    move-result-object p1

    iput-object p1, v2, Lcom/estrongs/android/util/q0$a;->b:Ljava/lang/String;

    .line 47
    iput p3, v2, Lcom/estrongs/android/util/q0$a;->c:I

    .line 48
    iput-object p4, v2, Lcom/estrongs/android/util/q0$a;->e:Landroid/graphics/Bitmap;

    .line 49
    sget-object p1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {p1}, Ljava/util/LinkedList;->size()I

    move-result p1

    sget p2, Lcom/estrongs/android/util/q0;->e:I

    if-ge p1, p2, :cond_9

    .line 50
    sget-object p1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-direct {p0, p1, v2, p5}, Lcom/estrongs/android/util/q0;->a(Ljava/util/LinkedList;Lcom/estrongs/android/util/q0$a;Z)V

    goto :goto_0

    :cond_9
    if-eqz p5, :cond_a

    .line 51
    sget-object p1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {p1}, Ljava/util/LinkedList;->removeLast()Ljava/lang/Object;

    .line 52
    sget-object p1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-direct {p0, p1, v2, p5}, Lcom/estrongs/android/util/q0;->a(Ljava/util/LinkedList;Lcom/estrongs/android/util/q0$a;Z)V

    .line 53
    :cond_a
    :goto_0
    monitor-exit v0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw p1

    :cond_b
    :goto_1
    return-void
.end method

.method public a(Ljava/lang/String;Z)V
    .locals 6

    .line 14
    invoke-static {}, Lcom/estrongs/android/pop/l;->L1()Lcom/estrongs/android/pop/l;

    move-result-object v0

    .line 15
    invoke-virtual {v0}, Lcom/estrongs/android/pop/l;->l1()Z

    move-result v0

    if-eqz v0, :cond_0

    if-nez p2, :cond_0

    return-void

    :cond_0
    if-eqz p2, :cond_1

    const-string v0, "/"

    .line 16
    invoke-virtual {p1, v0}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 17
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    :cond_1
    move-object v2, p1

    const/4 v1, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x1

    move-object v0, p0

    move v3, p2

    .line 18
    invoke-virtual/range {v0 .. v5}, Lcom/estrongs/android/util/q0;->a(Ljava/lang/String;Ljava/lang/String;ILandroid/graphics/Bitmap;Z)V

    return-void
.end method

.method public b()V
    .locals 2

    .line 15
    iget-object v0, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v0, :cond_0

    return-void

    :cond_0
    :try_start_0
    const-string v1, "DELETE FROM visit_history"

    .line 16
    invoke-virtual {v0, v1}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 17
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :goto_0
    return-void
.end method

.method public declared-synchronized c()V
    .locals 2

    monitor-enter p0

    .line 11
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    .line 12
    sput-object v0, Lcom/estrongs/android/util/q0;->d:Lcom/estrongs/android/util/q0;

    .line 13
    iget-object v1, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 14
    iput-object v0, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0

    .line 15
    :catch_0
    :cond_0
    :goto_0
    monitor-exit p0

    return-void
.end method

.method public d()[Lcom/estrongs/android/util/q0$a;
    .locals 2

    .line 1
    sget-object v0, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {v0}, Ljava/util/LinkedList;->size()I

    move-result v0

    new-array v0, v0, [Lcom/estrongs/android/util/q0$a;

    .line 2
    sget-object v1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {v1, v0}, Ljava/util/LinkedList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Lcom/estrongs/android/util/q0$a;

    return-object v0
.end method

.method public e()Z
    .locals 1

    .line 1
    iget-boolean v0, p0, Lcom/estrongs/android/util/q0;->b:Z

    return v0
.end method

.method public f()V
    .locals 2

    .line 1
    iget-boolean v0, p0, Lcom/estrongs/android/util/q0;->b:Z

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    return-void

    .line 2
    :cond_0
    iput-boolean v1, p0, Lcom/estrongs/android/util/q0;->b:Z

    const/16 v0, 0x14

    .line 3
    invoke-virtual {p0, v0}, Lcom/estrongs/android/util/q0;->a(I)V

    .line 4
    invoke-virtual {p0}, Lcom/estrongs/android/util/q0;->g()V

    return-void
.end method

.method public g()V
    .locals 13

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_9

    sget v0, Lcom/estrongs/android/util/q0;->e:I

    if-nez v0, :cond_0

    goto/16 :goto_6

    .line 2
    :cond_0
    invoke-direct {p0}, Lcom/estrongs/android/util/q0;->k()V

    const/4 v0, 0x0

    .line 3
    :try_start_0
    invoke-static {}, Lcom/estrongs/android/pop/l;->L1()Lcom/estrongs/android/pop/l;

    move-result-object v1

    .line 4
    invoke-virtual {v1}, Lcom/estrongs/android/pop/l;->l1()Z

    move-result v1

    const/4 v2, 0x0

    const/4 v3, 0x1

    if-eqz v1, :cond_1

    const-string v1, "isdir=?"

    new-array v4, v3, [Ljava/lang/String;

    const-string v5, "1"

    aput-object v5, v4, v2

    move-object v7, v1

    move-object v8, v4

    goto :goto_0

    :cond_1
    move-object v7, v0

    move-object v8, v7

    .line 5
    :goto_0
    iget-object v4, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v5, "visit_history"

    const/4 v1, 0x3

    new-array v6, v1, [Ljava/lang/String;

    const-string v1, "path"

    aput-object v1, v6, v2

    const-string v1, "isdir"

    aput-object v1, v6, v3

    const-string v1, "title"

    const/4 v12, 0x2

    aput-object v1, v6, v12

    const/4 v9, 0x0

    const/4 v10, 0x0

    const/4 v11, 0x0

    invoke-virtual/range {v4 .. v11}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0

    if-eqz v0, :cond_5

    .line 6
    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v1

    if-nez v1, :cond_2

    goto :goto_3

    .line 7
    :cond_2
    invoke-interface {v0}, Landroid/database/Cursor;->getCount()I

    move-result v1

    .line 8
    sget v4, Lcom/estrongs/android/util/q0;->e:I

    if-le v1, v4, :cond_3

    .line 9
    sget v4, Lcom/estrongs/android/util/q0;->e:I

    sub-int/2addr v1, v4

    invoke-interface {v0, v1}, Landroid/database/Cursor;->moveToPosition(I)Z

    move-result v1

    goto :goto_1

    .line 10
    :cond_3
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v1

    .line 11
    :goto_1
    sget-object v4, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {v4}, Ljava/util/LinkedList;->clear()V

    :goto_2
    if-eqz v1, :cond_4

    .line 12
    invoke-interface {v0, v12}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-interface {v0, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/estrongs/android/util/h0;->e(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    invoke-interface {v0, v3}, Landroid/database/Cursor;->getInt(I)I

    move-result v7

    const/4 v8, 0x0

    const/4 v9, 0x0

    move-object v4, p0

    invoke-virtual/range {v4 .. v9}, Lcom/estrongs/android/util/q0;->a(Ljava/lang/String;Ljava/lang/String;ILandroid/graphics/Bitmap;Z)V

    .line 13
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    move-result v1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_2

    :cond_4
    if-eqz v0, :cond_7

    goto :goto_4

    :cond_5
    :goto_3
    if-eqz v0, :cond_6

    .line 14
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    :cond_6
    return-void

    :catchall_0
    move-exception v1

    goto :goto_5

    :catch_0
    move-exception v1

    .line 15
    :try_start_1
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    if-eqz v0, :cond_7

    .line 16
    :goto_4
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    :cond_7
    return-void

    :goto_5
    if-eqz v0, :cond_8

    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 17
    :cond_8
    throw v1

    :cond_9
    :goto_6
    return-void
.end method

.method public h()V
    .locals 7

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v0, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x0

    .line 2
    :try_start_0
    invoke-virtual {p0}, Lcom/estrongs/android/util/q0;->b()V

    .line 3
    sget-object v1, Lcom/estrongs/android/util/q0;->f:Ljava/util/LinkedList;

    invoke-virtual {v1}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/estrongs/android/util/q0$a;

    .line 4
    new-instance v3, Landroid/content/ContentValues;

    invoke-direct {v3}, Landroid/content/ContentValues;-><init>()V

    const-string v4, "title"

    .line 5
    iget-object v5, v2, Lcom/estrongs/android/util/q0$a;->d:Ljava/lang/String;

    invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v4, "isdir"

    .line 6
    iget v5, v2, Lcom/estrongs/android/util/q0$a;->c:I

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    const-string v4, "path"

    .line 7
    iget-object v2, v2, Lcom/estrongs/android/util/q0$a;->a:Ljava/lang/String;

    invoke-virtual {v3, v4, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 8
    iget-object v2, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v4, "visit_history"

    invoke-virtual {v2, v4, v0, v3}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    :cond_1
    :try_start_1
    const-string v1, "DELETE FROM web_icon"

    .line 9
    iget-object v2, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2, v1}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 10
    sget-object v1, Lcom/estrongs/android/util/q0;->g:Ljava/util/HashMap;

    invoke-virtual {v1}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 11
    :goto_1
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2

    if-eqz v2, :cond_2

    .line 12
    :try_start_2
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map$Entry;

    .line 13
    new-instance v3, Landroid/content/ContentValues;

    invoke-direct {v3}, Landroid/content/ContentValues;-><init>()V

    const-string v4, "domain"

    .line 14
    invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/String;

    invoke-virtual {v3, v4, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 15
    new-instance v4, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v4}, Ljava/io/ByteArrayOutputStream;-><init>()V

    .line 16
    invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/graphics/Bitmap;

    sget-object v5, Landroid/graphics/Bitmap$CompressFormat;->PNG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v6, 0x64

    invoke-virtual {v2, v5, v6, v4}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    const-string v2, "icon"

    .line 17
    invoke-virtual {v4}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v5

    invoke-virtual {v3, v2, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;[B)V

    .line 18
    invoke-virtual {v4}, Ljava/io/ByteArrayOutputStream;->close()V

    .line 19
    iget-object v2, p0, Lcom/estrongs/android/util/q0;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v4, "web_icon"

    invoke-virtual {v2, v4, v0, v3}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    goto :goto_1

    :catch_1
    move-exception v2

    .line 20
    :try_start_3
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_2

    goto :goto_1

    :catch_2
    :cond_2
    return-void
.end method
